INSTALLATION CONTRIBUTION "ORDER-ALERT SMS v1.0"
------------------------------------------------
par Sardokar


L'installation de cette cointribution est on ne peut plus simple cependant il y a des tapes  respecter.

Tout d'abord il faut s'inscrire sur le site via le lien suivant http://www.123-sms.net/?par=os-comm (le ?par=os-comm n'est pas obligatoire MAIS permet au service client de vous identifier comme utilisateur d'os-commerce pour une prise en charge plus rapide du service technique ou commercial si vous avez un soucis d'installation)


Une fois que votre compte est cr vous pouvez charger votre compte de quelques SMS pour faire des tests.

Maintenant mettons les mains dans os-commerce :


Il faut ouvrir votre fichier checkout_success.php

3 tapes :

_____1re tape________Cherchez la ligne suivante :_______________________________

  if ($global['global_product_notifications'] != '1') {
    $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
    $orders = tep_db_fetch_array($orders_query);
	
	
    $products_array = array();
    $products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name");
    while ($products = tep_db_fetch_array($products_query)) {
      $products_array[] = array('id' => $products['products_id'],
                                'text' => $products['products_name']);
    }
  }


-------------Remplacez le tout par : -------------------------------------

  if ($global['global_product_notifications'] != '1') {
    $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
    $orders = tep_db_fetch_array($orders_query);

//Order-Alert SMS v1.0
//l'utilisation de cette contrib ncessite une inscription chez le fournisseur de SMS : http://www.123-SMS.net/?par=os-comm pour pouvoir recevoir une alerte SMS d'une vente.
//deb contrib Order-Alert SMS v1.0
   $orders_ht = tep_db_query("select * from orders_total where orders_id = '" . (int)$orders['orders_id'] . "' AND class = 'ot_total' order by orders_total_id desc limit 1");
   $orders_ht2 = tep_db_fetch_array($orders_ht);
   $orders_tva = tep_db_query("select * from orders_total where orders_id = '" . (int)$orders['orders_id'] . "' AND class = 'ot_tax' order by orders_total_id desc limit 1");
   $orders_tva2 = tep_db_fetch_array($orders_tva);   	
//fin contrib-Order Alert SMS v1.0
	
	
    $products_array = array();
    $products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name");
    while ($products = tep_db_fetch_array($products_query)) {
      $products_array[] = array('id' => $products['products_id'],
                                'text' => $products['products_name']);
    }
  }


______2me tape_______Cherchez la ligne suivante :_______________________________


            <td valign="top"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>

            <td valign="top" class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?><div align="center"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_SUCCESS; ?>


-------------Remplacez le tout par : -------------------------------------


            <td valign="top"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>
<?
//deb contrib Order Alert SMS v1.0
  $sms_destination = "0688888888"; // numro de portable (SANS ESPACE) pour l'international mettre le code international sans le 00 exemple pour la France 33688888888
  $sms_email = "monemail@email.com";  // email d'inscription  123-sms.net(SANS ESPACE)
  $sms_pass = "M2PASS";  // mot de passe gnr par 123-sms.net(SANS ESPACE)
  $initiale_boutique = "LCAV"; // Saisissez les initiales de votre boutique (SANS ESPACE) ex : La cave  vin -> LCAV

$ht = ($orders_ht2 ['value']);
$message = "Comd%20$initiale_boutique%20:***";
$ht2 = number_format($ht,2,",","");
$message .= $ht2;
$message .= "HT%20/%20";
$tva = ($orders_tva2 ['value']);
$ttc = ($ht + $tva);
$ttc2 = number_format($ttc,2,",","");
$message .= "$ttc2%20TTC";
$message .= "***Dtails%20:***";
$products_displayed = array();
    for ($i=0, $n=sizeof($products_array); $i<$n; $i++) {
      if (!in_array($products_array[$i]['id'], $products_displayed)) {
	  $produit = ($products_array[$i]['text']);
	  $produit2 = substr($produit,0,10);
	    $message .=  "-";
        $message .=  $produit2;
		$message .= "***";
      }
    }
//fin contrib Order Alert SMS v1.0
?>
            <td valign="top" class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?><div align="center"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_SUCCESS; ?>


_____3meet dernire tape________Cherchez la ligne suivante :_________________________

<?php require(DIR_WS_INCLUDES . 'footer.php');?>



-------------Remplacez le tout par : -------------------------------------

<?php require(DIR_WS_INCLUDES . 'footer.php'); 
//deb contrib Order Alert SMS v1.0
file("http://www.123-sms.net/http.php?email=$sms_email&pass=$sms_pass&numero=$sms_destination&message=".urlencode($message));
//fin contrib Order Alert SMS v1.0
?>

________________________________________________________________________

Maintenant remplacez le fichier sur votre site vous recevrez un SMS pour chaque vente effectue.

A+ Sardokar